package com.cadre.system.service.impl;

import com.cadre.system.domain.officer.A10;
import com.cadre.system.domain.officer.ProfessInfo;
import com.cadre.system.mapper.A10Mapper;
import com.cadre.system.service.ProfessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cadre.common.utils.oldutil.DateUtil;

import java.util.ArrayList;
import java.util.List;

@Service("professService")
public class ProfessServiceImpl implements ProfessService {
    @Autowired
    private A10Mapper a10Mapper;

    @Override
    public List<ProfessInfo> proMsg(String personid) {
        List<ProfessInfo> professInfos = new ArrayList<>();
        List<A10> a10s = this.a10Mapper.selectByPersonid(personid);
        if (a10s.size() != 0) {
            for (int i = 0; i < a10s.size(); i++) {
                ProfessInfo professInfo = new ProfessInfo();
                professInfo.setFlowid(a10s.get(i).getFlowid());
                professInfo.setPersonid(a10s.get(i).getPersonid());
                professInfo.setA1015(DateUtil.dateToStr(a10s.get(i).getA1015()));
                professInfo.setA1020(a10s.get(i).getA1020());
                professInfos.add(professInfo);
            }
        } else {
            System.out.println("--------------A10 null--------------");
        }
        return professInfos;
    }
}
